package com.caowei.weicimpress.weicimpress;

import android.support.v7.app.ActionBar;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.TextView;

import butterknife.InjectView;

/**
 * Created by caoweiPc on 2014/8/5.
 */
public abstract class InputBaseActivity extends BaseActivity {
    @InjectView(R.id.path)
    TextView actiobarPath;
    @InjectView(R.id.ok)
    TextView ok;
    @Override
    protected void initactioBar() {
        ActionBar actionBar=getSupportActionBar();
        bar=actionBar;
        actionBar.setDisplayOptions(0, ActionBar.DISPLAY_SHOW_TITLE|ActionBar.DISPLAY_USE_LOGO);
        actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
        View v= LayoutInflater.from(this).inflate(R.layout.actionbar_custom1,null,false);
        actionBar.setCustomView(v);
        actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_HOME
                |ActionBar.DISPLAY_SHOW_CUSTOM|ActionBar.DISPLAY_HOME_AS_UP);
        actionBar.setHomeAsUpIndicator(R.drawable.up);
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
            case android.R.id.home:
                finish();
                return true;
            default:
                return super.onOptionsItemSelected(item);
        }
    }
}
